//
//  YShareSheetScene.m
//  WidgetTest
//
//  Created by 李明明 on 15/10/15.
//  Copyright © 2015年 李明明. All rights reserved.
//

#import "YShareSheetScene.h"
#import "YShareSheetView.h"
@interface YShareSheetScene ()<ShareSheetDelegate>
@end

@implementation YShareSheetScene

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        YShareSheetView *shareSheet = [[[NSBundle mainBundle] loadNibNamed:@"YShareSheetView" owner:self options:nil] lastObject];
        shareSheet.translatesAutoresizingMaskIntoConstraints = NO;
        [shareSheet setType:^(platType type){
            if (type == kSina) {
                NSLog(@"1");
            }else if (type == kWeChat) {
                NSLog(@"2");
            }else if (type == kQQZones) {
                NSLog(@"3");
            }else if (type == kQQfriends) {
                NSLog(@"4");
            }else {
                NSLog(@"cancel");
            }
        }];
        // if you want use delegate, place remove setType: selector
    //        shareSheet.delegate = self;
    });
}
- (void)clickBtns:(platType)index
{
    if (index == kSina) {
        NSLog(@"sina function");
    }else if (index == kWeChat) {
        NSLog(@"weixin function");
    }else if (index == kQQZones) {
        NSLog(@"qqzone function");
    }else if (index == kQQfriends) {
        NSLog(@"qq function");
    }else {
        NSLog(@"cancel function");
    }
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
